<?php

namespace Biz\module\Classes\wiki;

use Biz\model\wiki\WikiBasic as mWikiBasic;
use hhz\constant\redis\redisKeys;
use Hhz\Redis\newCache;

class WikiBasic
{
    /**
     * 获取wiki basic的基础信息
     * @param $basicIds
     * @return array
     */
    public static function getWikiBasicInfos($basicIds)
    {
        $redis = new newCache(redisKeys::KEY_B_CACHE_WIKI_BASIC_INFO);
        list($cacheData, $noCacheKeys) = $redis->getCaches($basicIds);
        //$noCacheKeys = $basicIds;//缓存debug
        if ($noCacheKeys) {
            $list = mWikiBasic::getInfosByBasicIds($noCacheKeys);
            if (!empty($list)) {
                $redis->setCaches($list);
            }
            $result = $cacheData + $list;
        } else {
            $result = $cacheData;
        }
        return $result;
    }


}